package com.wmlive.hhvideo.heihei.personal.adapter;

import android.view.ViewGroup;

import cn.wmlive.hhvideo.R;

import com.wmlive.hhvideo.heihei.beans.main.ShortVideoItem;
import com.wmlive.hhvideo.utils.imageloader.GlideLoader;
import com.wmlive.hhvideo.widget.refreshrecycler.RefreshAdapter;
import com.wmlive.hhvideo.widget.refreshrecycler.RefreshRecyclerView;

import java.util.List;

/**
 * Created by XueFei on 2017/5/27.
 */

public class PersonalLoveAdapter extends RefreshAdapter<PersonalLoveHolder, ShortVideoItem> {
    public PersonalLoveAdapter(List<ShortVideoItem> list, RefreshRecyclerView refreshView) {
        super(list, refreshView);
    }

    @Override
    public PersonalLoveHolder onCreateHolder(ViewGroup parent, int viewType) {
        return new PersonalLoveHolder(parent, R.layout.fragment_personal_video_item);
    }

    @Override
    public void onBindHolder(PersonalLoveHolder holder, int position, ShortVideoItem data) {
        if (null != data) {
            GlideLoader.loadImage(data.getOpus_small_cover(), holder.ivBg, R.drawable.bg_video_default_16_9);
            holder.tvCount.setText(String.valueOf(data.getLike_count()));
        }
    }
}
